<%@page import="java.util.Iterator"%>
<%@page import="cn.com.entity.Pexamination"%>
<%@page import="java.util.Set"%>
<%@page import="cn.com.dao.PexaminationPackageDao"%>
<%@page import="cn.com.entity.PexaminationPackage"%>
<%@page import="cn.com.entity.PexaminationForm"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2 align="center">我的体检单</h2>
<table align="center" border="1" width="80%">
	<tr>
		<td>体检单序号</td>
		<td>体检类别 ------体检结果</td>
		<td>体检状态</td>
		<td>医生建议</td>
		<td>体检时间</td>
	</tr>
<% 
if(session.getAttribute("pexformbyconsumeridlist")!=null){
	List<PexaminationForm> list=(List<PexaminationForm>)session.getAttribute("pexformbyconsumeridlist");
	for(int i=0;i<list.size();i++){
	PexaminationForm pf=list.get(i);
	int  pexaminationpackageid=pf.getPexaminationpackageid();
	//通过套餐id获取一个套餐对象
		PexaminationPackage pp=new PexaminationPackage();
		pp.setPexaminationpackageid(pexaminationpackageid);
		PexaminationPackageDao ppd=new PexaminationPackageDao();
		PexaminationPackage pexaminationPackage=ppd.selectPexaminationPackageByid(pp);
		
	String status="已体检";
	if(pf.getPexaminationstatus()==0){
				status="未体检";
%>	
	<tr>
		<td><%=i+1 %></td>
		<td>
<%
Set<Pexamination> pexset=pexaminationPackage.getPexaminationset();
Iterator<Pexamination> it=pexset.iterator();
while(it.hasNext()){
	Pexamination p=it.next();
%>
	<%=p.getPexaminationname() %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<%=p.getPexaminationresult() %><br/>	
<%} %>			
		</td>
		<td><%=status%></td>
		<td><%=pf.getPexaminationadvice() %></td>
		<td><%=pf.getPexaminationtime() %></td>
	</tr>
<%			}
		}
	} %>	
</table>
</body>
</html>